import request from '@/utils/request'
//获取目录树
export function fetchMasterdataDirectoryList(data) {
  return request({
    url: '/system/masterdata/MasterdataDirectory/list',
    method: 'post',
    data,
  })
}

export function treeListApi(data) {
  return request({
    url: '/system/metamodel/treeListIsDirectory',
    method: 'post',
    data,
  })
}
//获取目录详情
export function getMasterdataDirectory(id) {
  return request({
    url: '/system/masterdata/MasterdataDirectory/detail/' + id,
    method: 'get',
    params: { id },
  })
}
//新增目录
export function createMasterdataDirectory(data) {
  return request({
    url: '/system/masterdata/MasterdataDirectory/add',
    method: 'post',
    data,
  })
}
//修改目录
export function updateMasterdataDirectory(data) {
  return request({
    url: '/system/masterdata/MasterdataDirectory/update',
    method: 'post',
    data,
  })
}
//删除目录
export function deleteMasterdataDirectory(id) {
  return request({
    url: '/system/masterdata/MasterdataDirectory/delete/' + id,
    method: 'post',
  })
}

export function deletecaveasmodelid({ id }) {
  console.log(id)
  return request({
    url: `/system/metadataModel/table/detail/${id}`,
    method: 'get',
  })
}

// masterdata/MasterdataDirectory/delete/{id}

export function deletedatacaveasmodelid({ id }) {
  console.log(id)
  return request({
    url: `/system/masterdata/MasterdataDirectory/delete/${id}`,
    method: 'post',
  })
}

export function associationTableDetail(params) {
  return request({
    url: `/system/metadataModel/table/associationTableDetail/${params.params.id}`,
    method: 'get',
  })
}
